class lustre::client_module (
  $clientversion        = "2.5.3-2.6.32_754.17.1.el6.x86_64.x86_64",
) {

  
# install lustre pkg
  case $operatingsystemmajrelease {
     '7': {
       if $ibenable {
         $lustrerepo = "${operatingsystemrelease}_ib"
	 }
       else {
         $lustrerepo = "${operatingsystemrelease}"
       }
        yumrepo {"lustre":
          baseurl   =>  "http://mirror.ihep.ac.cn/yum/lustre/${lustrerepo}/client/",
          descr => "lustre client",
          enabled => 1,
          gpgcheck => 0,
          priority => 20,
          before   => Yumrepo['site']
        }
        yumrepo {"e2fs":
          baseurl   =>  "http://mirror.ihep.ac.cn/yum/lustre/public/e2fsprogs/1.44.3.wc1/el7/",
          descr => "e2fs",
          enabled => 1,
          gpgcheck => 0,
          priority => 20,
          before   => Yumrepo['site']
        }
        package { ["lustre-iokit",
                   "lustre-client",
                   "lustre-client-debuginfo",
                   "lustre-client-tests",
                   "kmod-lustre-client",
                   "kmod-lustre-client-tests"]:
                 ensure => 'installed',
                 require => Yumrepo['site'],
       }
    }
   /8|9/: {
       if $ibenable {
         $lustrerepo = "${facts['os']['release']['full']}_ib"
       }    
       else {
         $lustrerepo = "${facts['os']['release']['full']}"
       }
        yumrepo {"lustre":
          baseurl   =>  "http://${mirrorserver}/yum/lustre/${lustrerepo}/client/",
          descr => "lustre client",
          enabled => 1,
          gpgcheck => 0,
          priority => 20,
          before   => Yumrepo['site']
        }
        yumrepo {"e2fs":
          baseurl   =>  "http://${mirrorserver}/yum/lustre/public/e2fsprogs/1.47.0.wc6/el${facts['os']['release']['major']}/",
          descr => "e2fs",
          enabled => 1, 
          gpgcheck => 0, 
          priority => 20,
          before   => Yumrepo['site']
        }
        package { ["lustre-iokit",
                   "lustre-client",
                   "lustre-client-dkms",
                   "lustre-client-debuginfo",
                   "kmod-lustre-client"]:
                 ensure => 'installed',
                 require => Yumrepo['site'],
       }     
       package { [ "lustre-client-tests",
                   "kmod-lustre-client-tests"]:
                 ensure => 'absent',
                 require => Yumrepo['site'],
       }

    }

  } 
}
